package StringBuilder_package;

public class StringBuilder_demo4 {
    public static void main(String[] args) {
        StringBuilder sb=new StringBuilder();

        //容量：最多装多少
        //长度：已经装了多少
        System.out.println(sb.capacity());//16
        System.out.println(sb.length());//0

        sb.append("abc");
        System.out.println(sb.capacity());//16
        System.out.println(sb.length());//3

        sb.append("asdfghjklsddcewe");
        System.out.println(sb.capacity());//老容量 * 2 + 2
        System.out.println(sb.length());
    }
}
